import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/home',
    name: 'Home',
    component: Home,
	children:[
		{
		  path: '/home',
		  name: 'Main',
		  component: () => import( '../views/Main.vue')
		},
		{
		  path: '/home/shopcart',
		  name: 'ShopCart',
		  component: () => import( '../views/ShopCart.vue')
		},
		{
		  path: '/home/orders',
		  name: 'Orders',
		  component: () => import( '../views/Orders.vue')
		},
		{
		  path: '/home/mine',
		  name: 'Mine',
		  component: () => import( '../views/Mine.vue')
		}
		
	]
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },
  {
    path: '/',
    name: 'Login',
    component: () => import( '../views/Login.vue')
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import( '../views/Register.vue')
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import( '../views/Register.vue')
  },
  {
    path: '/zhifu',
    name: 'ZhiFu',
    component: () => import( '../views/ZhiFu.vue')
  },
  {
	  path: '/newaddress',
	  name: 'NewAddress',
	  component: () => import( '../views/NewAddress.vue')
  },
  {
  	  path: '/editaddress',
  	  name: 'EditAddress',
  	  component: () => import( '../views/EditAddress.vue')
  },
  {
  	  path: '/qrzhifu',
  	  name: 'QRZhiFu',
  	  component: () => import( '../views/QRZhiFu.vue')
  },
  {
    path: '/gladdress',
    name: 'GLAddress',
    component: () => import( '../views/GLAddress.vue')
  },
  {
    path: '/tjorder',
    name: 'TJOrder',
    component: () => import( '../views/TJOrder.vue')
  },
  {
    path: '/productxq',
    name: 'ProductXQ',
    component: () => import( '../views/ProductXQ.vue')
  },
  {
    path: '/wproductxq',
    name: 'WProductXQ',
    component: () => import( '../views/WProductXQ.vue')
  },
  {
    path: '/qkorders',
    name: 'QKOrders',
    component: () => import( '../views/QKOrders.vue')
  },
  {
    path: '/search',
    name: 'Search',
    component: () => import( '../views/Search.vue')
  },
  {
    path: '/searchjg',
    name: 'SearchJG',
    component: () => import( '../views/SearchJG.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
